/**
 * Keafmd
 *
 * @ClassName: Demo4
 * @Description: Demo4
 * @author: lijl
 * @date: 2022/12/11 14:31
 * @Blog: https://keafmd.blog.csdn.net/
 */
class Material{
    protected String name;
    protected double price;
    Material(String name,double price){
        this.name = name;
        this.price = price;
    }
    public String toString(){
        return name+"的价格是"+price;
    }
}
class Wood extends Material{
    private String color;
    Wood(String name,double price,String color){
        super(name,price);
        this.color = color;
    }
    public String toString(){
        return name+"的价格是"+price+"，颜色是"+color;
    }
}
public class Demo4 {
    public static void main(String[] args) {
        Material m = new Material("大理石",1000);
        System.out.println(m.toString());
        Wood w = new Wood("檀木",1200,"红棕");
        System.out.println(w.toString());
    }
}
